package com.easysale.services;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.easysale.dao.ProductDAO;
import com.easysale.domain.Product;

@Service("productService")
public class ProductServiceImpl implements ProductService {
    private static Logger logger = Logger.getLogger("ProductService");

    @Autowired
    ProductDAO productDAO;
    
    
	@Override
	@Transactional
	public void addProduct(Product product) {
		productDAO.addProduct(product);
	}

	@Override
	@Transactional
	public List<Product> products() {
		
		return productDAO.products();
	}

	@Override
	@Transactional
	public void removeProduct(Integer productId) {
		productDAO.deleteProduct(productId);
		
	}
}
